package com.weiyuwqj.app.mobile.reward;

import com.weiyuwqj.api.service.BasCouponService;
import com.weiyuwqj.api.service.BasExperiencedGoldService;
import com.weiyuwqj.api.service.BasTicketService;
import com.weiyuwqj.api.service.SysConfigTicketRuleService;
import com.weiyuwqj.api.service.SysConfigTicketService;
import com.weiyuwqj.api.common.PageList;
import com.weiyuwqj.api.common.Paginator;
import com.weiyuwqj.api.constant.Constants;
import com.weiyuwqj.api.model.TicketParamEntity;
import com.weiyuwqj.api.util.IpUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 体验金/冻结金 接口
 * Created by zhangyong on 2016/1/13.
 */
@Controller
public class MobileRewardController {

    @Autowired
    private BasCouponService couponService;

    @Autowired
    private BasTicketService ticketService;

    @Autowired
    private BasExperiencedGoldService experiencedGoldService;

    @Autowired
    private SysConfigTicketRuleService ruleService;
    /**
     * 红包列表
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/mobile/coupon/list")
    public Object getList(Paginator p,Integer userId){
        Map map=new HashMap();
        map.put("userId",userId);
        return couponService.listCouponAndConf(p,map);
    }


    /**
     * 加息券列表
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/mobile/ticket/list")
    public Object getTicketList(Paginator p,Integer userId){
        Map map=new HashMap();
        map.put("userId",userId);
        return ticketService.listTicketAndConf(p,map);
    }

    /**
     * 理财金列表
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/mobile/gold/list")
    public Object getGoldList(Paginator p,Integer userId){
        Map map=new HashMap();
        map.put("userId",userId);
        return experiencedGoldService.getList(p,map);
    }


}
